//
// Created by Martin on 2022/12/7.
//
#include <regex>
#include <iostream>
#include <string>

using namespace std;

// example 1:简单的使用正则表达式库
// Page 646, C++ Primer 5th 中文版

int main()
{
    string pattern("[^c]ei");
    pattern = "[[:alpha:]]*" + pattern + "[[:alpha:]]*";
    regex r(pattern);
    smatch results;
    string test_str = "receipt freind theif receive";
    if (regex_search(test_str, results, r))
        cout << results.str() << endl;

    return 0;
}
